package com.elinkway.infinitemovies.bean;

import com.lvideo.http.bean.LVideoBaseBean;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 新截流信息实体类
 * <p>
 * Created by wangyemin on 2015/12/7.
 */
public class OutSiteStreamEntity implements LVideoBaseBean, Comparable<OutSiteStreamEntity> {
    private List<String> allowFormats; //解析支持的清晰度集合
    private String requestFormat; //请求的清晰度
    private String osType; //系统类型
    private String eid; //同一解析请求的唯一标识
    private String isDownload; //是否允许下载
    private List<String> stream_list; //流地址
    private List<String> api_list; //客户端解析地址
    private String user_agent; //UA信息
    private Map<String, String> rule; //本地解析用
    private int priority; //执行截流优先级 0~9
    private boolean isHasRule; //本地截流参数是否存在
    private String totalDuration;
    private List<String> durationList;
    private List<Double> fSizeList = new ArrayList<>();
    private double totalSize;
    private String clientParseType;

    public String getClientParseType() {
        return clientParseType;
    }

    public void setClientParseType(String clientParseType) {
        this.clientParseType = clientParseType;
    }

    public String getTotalDuration() {
        return totalDuration;
    }

    public void setTotalDuration(String totalDuration) {
        this.totalDuration = totalDuration;
    }

    public List<String> getDurationList() {
        return durationList;
    }

    public void setDurationList(List<String> durationList) {
        this.durationList = durationList;
    }

    public double getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(double totalSize) {
        this.totalSize = totalSize;
    }

    public void setfSizeList(List<Double> fSizeList) {
        this.fSizeList = fSizeList;
    }

    public List<Double> getfSizeList() {
        return fSizeList;

    }

    public List<String> getAllowFormats() {
        return allowFormats;
    }

    public void setAllowFormats(List<String> allowFormats) {
        this.allowFormats = allowFormats;
    }

    public String getRequestFormat() {
        return requestFormat;
    }

    public void setRequestFormat(String requestFormat) {
        this.requestFormat = requestFormat;
    }

    public String getOsType() {
        return osType;
    }

    public void setOsType(String osType) {
        this.osType = osType;
    }

    public String getEid() {
        return eid;
    }

    public void setEid(String eid) {
        this.eid = eid;
    }

    public String getIsDownload() {
        return isDownload;
    }

    public void setIsDownload(String isDownload) {
        this.isDownload = isDownload;
    }

    public List<String> getStream_list() {
        return stream_list;
    }

    public void setStream_list(List<String> stream_list) {
        this.stream_list = stream_list;
    }

    public List<String> getApi_list() {
        return api_list;
    }

    public void setApi_list(List<String> api_list) {
        this.api_list = api_list;
    }

    public String getUser_agent() {
        return user_agent;
    }

    public void setUser_agent(String user_agent) {
        this.user_agent = user_agent;
    }

    public Map<String, String> getRule() {
        return rule;
    }

    public void setRule(Map<String, String> rule) {
        this.rule = rule;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public boolean isHasRule() {
        return isHasRule;
    }

    public void setIsHasRule(boolean isHasRule) {
        this.isHasRule = isHasRule;
    }

    @Override
    public String toString() {
        return "OutSiteStreamEntity{" +
                "requestFormat='" + requestFormat + '\'' +
                ", osType='" + osType + '\'' +
                ", rule=" + rule +
                ", priority=" + priority +
                ", isHasRule=" + isHasRule +
                '}';
    }



    // 降序 9优先级最高
    @Override
    public int compareTo(OutSiteStreamEntity entity) {
        if (this == entity) {
            return 0;
        } else if (entity != null && entity instanceof OutSiteStreamEntity) {
            OutSiteStreamEntity obj = (OutSiteStreamEntity) entity;
            if (this.priority > obj.getPriority()) {
                return -1;
            } else {
                return 1;
            }
        } else {
            return 0;
        }
    }
}
